Show Code
import pandas as pd
import plotly.express as px

πŸ“ˆ Global Trend of Moderate Food Poverty Over Time

Storyline: This line chart represents the global trend of moderate food poverty over time, providing a visual representation of the fluctuating poverty rates worldwide. It reflects both global progress in reducing poverty as well as setbacks caused by global events such as conflicts, economic downturns, and health crises. This chart helps identify key moments in history when food insecurity worsened and allows for a deeper understanding of the factors driving these changes over the years.

Show Code
indicator = pd.read_excel("unicef_indicator_2.xlsx")
df = indicator[['country', 'time_period', 'obs_value', 'sex', 'indicator']].copy()
df = df[df['sex'] == 'Total']
df.dropna(subset=['obs_value'], inplace=True)
df['time_period'] = pd.to_numeric(df['time_period'], errors='coerce')

ts_df = df.groupby("time_period", as_index=False)["obs_value"].mean()

fig1 = px.line(ts_df, x="time_period", y="obs_value",
               title="Global Trend of Moderate Food Poverty Over Time",
               labels={"obs_value": "%"})
fig1.show()

πŸ“Š Top 10 Countries – Moderate Food Poverty

Storyline: This horizontal bar chart highlights the countries with the highest levels of moderate food poverty in the most recent year. By ranking the top 10 countries, this chart draws attention to the regions where the need for urgent intervention is greatest. It allows policymakers and organizations to identify key areas for humanitarian aid, where resources are most needed to combat hunger and malnutrition.

Show Code
latest_year = df['time_period'].max()
bar_df = df[df['time_period'] == latest_year]
top10 = bar_df.groupby("country", as_index=False)['obs_value'].mean().nlargest(10, 'obs_value')

fig2 = px.bar(top10, x="obs_value", y="country", orientation='h',
              title=f"Top 10 Countries – Moderate Food Poverty ({latest_year})",
              labels={"obs_value": "%", "country": "Country"})
fig2.show()

πŸ“‰ Gender Disparities – Male vs Female

Storyline: This scatter plot compares male and female food poverty rates in countries worldwide, highlighting the gender disparities in access to food. The chart reveals countries where females experience higher levels of food poverty, which is often linked to broader societal inequities such as unequal access to resources, education, and employment opportunities. It is crucial for addressing gender-specific policies and interventions to tackle food insecurity more effectively.

Show Code
sex_df = indicator[indicator['time_period'] == latest_year]
pivot = sex_df.pivot_table(index='country', columns='sex', values='obs_value').dropna().reset_index()

fig3 = px.scatter(pivot, x="Male", y="Female", hover_name="country",
                  trendline="ols",
                  title=f"Male vs Female Food Poverty ({latest_year})",
                  labels={"Male": "Male (%)", "Female": "Female (%)"})
fig3.show()

🌍 World Map – Country-Level Food Poverty Rates

Storyline: This choropleth map provides a geographic overview of food poverty rates across different countries, offering a clear visual of how the issue varies from region to region. The color-coded map easily shows which regions are most affected by moderate food poverty, helping to highlight critical areas where global efforts should focus. It also serves as a tool for global policymakers and international organizations to allocate resources effectively.

Show Code
map_df = df[df['time_period'] == latest_year]
avg_map = map_df.groupby("country", as_index=False)['obs_value'].mean()

fig4 = px.choropleth(avg_map, locations="country", locationmode="country names",
                     color="obs_value", hover_name="country",
                     title=f"World Map: Food Poverty Rates ({latest_year})",
                     color_continuous_scale="YlOrRd",
                     labels={"obs_value": "%"})
fig4.show()